<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>选课学生</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
	* {
		font-size: 11pt;
	}
	div {
		margin:20px;
		border: solid 2px gray;
		width: 150px;
		height: 150px;
		text-align: center;
	}
	li {
		margin: 10px;
	}
	
	#buy {
		background: url(<c:url value='/images/all.png'/>) no-repeat;
		display: inline-block;
		
		background-position: 0 -902px;
		margin-left: 30px;
		height: 36px;
		width: 146px;
	}
	#buy:HOVER {
		background: url(<c:url value='/images/all.png'/>) no-repeat;
		display: inline-block;
		
		background-position: 0 -938px;
		margin-left: 30px;
		height: 36px;
		width: 146px;
	}
</style>
  </head>
  
  <body>
<h1>选课学生</h1>
<c:choose>
	<c:when test="${empty reportList or fn:length(reportList) eq 0}">
		当前无学生选课1
	</c:when>
	<c:otherwise>
<table border="1" width="100%" cellspacing="0" background="black">

	<tr>
		<th>姓名</th>
		<th>编号</th>
		<th>成绩</th>
	</tr>
<c:forEach items="${reportList }" var="report">
	<tr>
		<td>${report.student.sname }</td>
		<td>${report.student.sid }</td>
		<td>
		<!--<c:choose>
			<c:when test="${fn:length(report.reportItems) == 1 }">
				<c:forEach items="${report.reportItems }" var="reportItem">
					${reportItem.score }
				</c:forEach>
			</c:when>
			<c:otherwise>
				<form action="<c:url value="/ReportServlet"/>" method="post" >
				<input type="hidden" name="method" value="add"/>
				<input type="hidden" name="cid" value="${cid }"/>
				<input type="hidden" name="sid" value="${student.sid }"/>
				<input style="width: 150px; height: 20px;" type="text" name="score"/>
				<input type="submit" value="录入成绩"/>
				</form>
			</c:otherwise>
		</c:choose>-->
		<c:if test="${fn:length(report.reportItems) == 1 }">
			<c:forEach items="${report.reportItems }" var="reportItem">
				<c:choose>
					<c:when test="${!empty reportItem }">
						${reportItem.score }
					</c:when>
					<c:otherwise>
						<form action="<c:url value="/report/addItem"/>" method="post" >
						<input type="hidden" name="cid" value="${cid }"/>
						<input type="hidden" name="sid" value="${report.student.sid }"/>
						<input style="width: 150px; height: 20px;" type="text" name="score"/>
						<input type="submit" value="录入成绩"/>
						</form>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</c:if>

		</td>
	</tr>
</c:forEach>



</table>
	</c:otherwise>
</c:choose>
  </body>
</html>
